<template>
  <div>
    <h3>修改账号密码 <span class="label label-default">modify</span></h3>
    <br />
    <div class="row">
      <div class="col-lg-5"></div>
      <div class="col-lg-1">
        <div class="input-group">
          <span> name: </span>
          <span>1111</span>
        </div>
        <!-- /input-group -->
      </div>
      <!-- /.col-lg-6 -->
      <div class="col-lg-2">
        <div class="input-group">
          <input
            type="text"
            class="form-control"
            placeholder="要修改后的name"
            v-model="name"
          /><br />
        </div>
        <!-- /input-group -->
      </div>
      <!-- /.col-lg-6 -->
      <div class="col-lg-4"></div>
    </div>
    <!-- /.row -->
    <br />
    <div class="row">
      <div class="col-lg-5"></div>
      <div class="col-lg-1">
        <div class="input-group">
          <span> password: </span>
          <span>1111</span>
        </div>
        <!-- /input-group -->
      </div>
      <!-- /.col-lg-6 -->
      <div class="col-lg-2">
        <div class="input-group">
          <input
            type="text"
            class="form-control"
            placeholder="要修改后的password"
            v-model="password"
          />
        </div>
        <!-- /input-group -->
      </div>
      <!-- /.col-lg-6 -->
      <div class="col-lg-4"></div>
    </div>
    <!-- /.row --><br />
    <div class="btn-group" role="group" aria-label="...">
      <button type="button" class="btn btn-default" @click="submit">
        修改
      </button>
      <button type="button" class="btn btn-default" @click="back">返回管理员界面</button>
    </div>
  </div>
</template>

<script>
import { requests } from "../../request/request";
import {modifyAxios} from "../../request/api"
export default {
  name: "modify",
  data() {
    return {
      name: "",
      password: "",
    };
  },
  computed: {
    json() {
      return {
        name: this.name,
        password: this.password,
      };
    },
  },
  methods: {
    submit() {
      let thisa=this;
      let s=this.$store.state.modify;
      console.log(s)
      let json = {
        "uid":s,
        "uname":this.name,
        "upassword":this.password
      }
      console.log(json)
      modifyAxios(json)
    },
    back() {
      window.history.go(-1);
    },
  },
};
</script>

<style>
</style>